/**
 * Copying (c) Qixin Technoligies Co.,Ltd.2019-2029.all rights reserved.
 */

package com.example.service;

import com.example.api.UserApi;
import com.example.mapper.SysUserInfoDao;
import com.example.entity.SysUserInfo;
import com.example.utils.StringUtils;
import lombok.extern.log4j.Log4j2;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

/**
 * 创  建   时  间： 2020/7/11
 * 版           本: V1.0
 * 作           者: qixin
 * 版  权   所  有: 版权所有(C)2019-2029
 * 公           司: 深圳市七智星科技有限公司
 */
@Log4j2
@Component
@Service(cluster = "failfast",loadbalance = "roundrobin",version = "${service.version}",timeout = 3000,interfaceClass=UserApi.class)
public class UserService implements UserApi {
    @Autowired
    private SysUserInfoDao userInfoDao;
    @Value("${dubbo.application.name}")
    private String serviceName;

    @Override
    public List<SysUserInfo> findAll() {
        log.info("[{}]:Hello World ...",serviceName);
        return userInfoDao.findAll();
    }

    @Override
    public SysUserInfo findById(Integer id) {
        return userInfoDao.findById(id);
    }
}
